package beans;

import java.sql.ResultSet;
import java.sql.SQLException;

public class LoginBean {
	
	
	public String loginType(String id,String password) throws SQLException{
		ResultSet rs=DBHelper.executeSelect("select type from JobLogin where username='"
												+id+"'and password ='"+ password+"'");
	
		if(rs.next()){
			return rs.getString("type");
		}else{
			return "Wrong";
		}
	}
	
	public boolean check(String userName) throws SQLException{
		ResultSet rs = DBHelper.executeSelect("select * from JobLogin where username='"+userName+"'");
		
		if(rs.next()){
			System.out.println("OK");
			return true;
		}else{
			return false;
		}
	}
}
